/*
 * Copyright (c) 2006, 2022, webrx.cn All rights reserved.
 *
 */
package cn.su;

import java.util.Random;

/**
 * <p>Project: jse2204 - Ex
 * <p>Powered by webrx On 2022-09-15 14:56:30
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Ex {
    public static void main(String[] args) {
        System.out.println(getPassword(8));
    }

    public static String getPassword(int... n) {
        int num = n.length == 0 ? 6 : n[0];
        String str = "0123456789_-=+'\",`~!@#$%^&*()abcdefghijklmnolpqrstuvwxyzABCDEFGHIJKLMNOLPQRSTUVWXYZ";
        StringBuilder sbu = new StringBuilder(6);
        Random rand = new Random();
        for (int i = 0; i < num; i++) {
            sbu.append(str.charAt(rand.nextInt(str.length())));
        }
        return sbu.toString();
    }
}
